Skip to content

ci: skip lefthook on spec-sync bot push#1866

Merged
felixweinberger merged 2 commits intomainfrom
fweinberger/spec-sync-skip-lefthook
Apr 13, 2026
Merged

ci: skip lefthook on spec-sync bot push#1866
felixweinberger merged 2 commits intomainfrom
fweinberger/spec-sync-skip-lefthook

Conversation

@felixweinberger
Copy link
Copy Markdown
Contributor

Skip lefthook's pre-push hooks when the spec-sync bot pushes its branch.

Motivation and Context

pnpm install installs lefthook git hooks on the runner, so the bot's git push runs typecheck:all/lint:all/build:all. When upstream schema.ts drifts in a way that requires SDK changes, typecheck fails and no PR is created — the drift is silently dropped instead of surfaced. This happened in run 23971433340. The PR's own CI is the right place for those checks.

How Has This Been Tested?

Workflow-only change; verified the diff. The next scheduled/dispatched run will exercise it.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Belt-and-suspenders: sets LEFTHOOK=0 and passes --no-verify so this stays robust if the hook manager changes.

pnpm install installs lefthook hooks on the runner, so the bot's git push runs typecheck/lint/build. When upstream schema drift breaks typecheck, the push fails and no PR is created. Set LEFTHOOK=0 and --no-verify so drift always opens a PR; the PR's own CI surfaces any breakage.
@felixweinberger felixweinberger requested a review from a team as a code owner April 9, 2026 12:08
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

⚠️ No Changeset found

Latest commit: b6b1dbb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 9, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@1866

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@1866

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@1866

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@1866

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@1866

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@1866

commit: b6b1dbb

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — simple, targeted fix that correctly surfaces spec drift as a PR instead of silently dropping it.

Extended reasoning...

Overview

Single-file CI workflow change adding LEFTHOOK=0 env var and --no-verify flag to the git push in the spec-sync bot job. Two complementary mechanisms (env var + git flag) are belt-and-suspenders to skip lefthook hooks during the automated push.

Security Risks

No security concerns. The change only affects a CI workflow that pushes to a dedicated update-spec-types branch and opens a PR — no direct production impact, no auth or secrets changes.

Level of Scrutiny

Low. This is a mechanical CI fix for a clearly documented failure mode. The approach is idiomatic (LEFTHOOK=0 is the documented way to disable lefthook; --no-verify is the standard git flag) and the fix is narrowly scoped to the one step that was failing.

Other Factors

No bugs found, no outstanding reviewer comments, minimal blast radius. The PR description includes a link to the failed run demonstrating the root cause.

Copy link
Copy Markdown
Contributor

@bhosmer-ant bhosmer-ant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the safety net is intact: ruleset on main requires build/test status checks + approval, so a spec-sync PR with broken typecheck cannot merge. lefthook.yml pre-push is exactly typecheck/lint/build as the comment says. The rationale holds — better a visible red-CI PR than a silently-failed bot push hiding spec drift.

nit: LEFTHOOK=0 and --no-verify are redundant (either alone works); harmless to keep both.

Review by Claude, checked by Basil.

@felixweinberger felixweinberger enabled auto-merge (squash) April 13, 2026 12:33
@felixweinberger felixweinberger merged commit 1693668 into main Apr 13, 2026
15 checks passed
@felixweinberger felixweinberger deleted the fweinberger/spec-sync-skip-lefthook branch April 13, 2026 12:35
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — simple CI fix to skip lefthook hooks during the spec-sync bot push, with belt-and-suspenders coverage via both LEFTHOOK=0 and --no-verify.

Extended reasoning...

Overview

Single-file change to . Adds env var and flag to the git push in the spec-sync automation step, preventing lefthook pre-push hooks (typecheck/lint/build) from blocking the bot when upstream schema drift causes type errors.

Security Risks

None. The change does not affect authentication, permissions, secrets handling, or any runtime code. It only modifies the CI behavior of an automated bot workflow. The --no-verify flag is scoped specifically to the bot's push, not to any developer-facing workflow.

Level of Scrutiny

Low. This is a minimal, targeted CI config fix with clear motivation (a real failed run is cited), no impact on application logic or security, and the approach is standard practice for bot/automation workflows.

Other Factors

No bugs found. No outstanding reviewer comments. The changeset-bot warning about no changeset is expected — this is a CI-only change with no package version impact. The fix is well-explained and uses a belt-and-suspenders approach that is robust to hook manager changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants